package com.youngjun.common.util;

import org.springframework.core.env.Environment;


public class PropUtils {

    private PropUtils() {
    }

    public static String get(String key) {
        return SpringUtils.getBean(Environment.class).getProperty(key);
    }

    public static String get(String key, String defaultValue) {
        return SpringUtils.getBean(Environment.class).getProperty(key, defaultValue);
    }

    public static <T> T get(String key, Class<T> targetType) {
        return SpringUtils.getBean(Environment.class).getProperty(key, targetType);
    }

    public static <T> T get(String key, Class<T> targetType, T defaultValue) {
        return SpringUtils.getBean(Environment.class).getProperty(key, targetType, defaultValue);
    }

}
